/*
 * 文件名：BaseFragment.java
 * 版权：Copyright 2006-2015 chinasoft Tech. Co. Ltd. All Rights Reserved. 
 * 描述： 功能简述
 * 修改人：Administrator
 * 修改时间：2015年1月4日
 * 修改内容：新增
 */
package com.app.notepad.ui.fragment;

import com.app.notepad.R;
import com.app.notepad.util.LogUtil;
import com.app.notepad.util.StringUtils;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

/**
 * <一句话功能简述> <功能详细描述>
 * 
 * @author Administrator [A001]
 * @version 2015年1月4日
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class BaseFragment extends Fragment {

    private static String TAG = BaseFragment.class.getSimpleName();

    public Context ctx;

    @Override
    public void onAttach(Activity activity) {
	super.onAttach(activity);
	LogUtil.i(TAG, "onAttach called...");

	this.ctx = getActivity();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
	LogUtil.i(TAG, "onCreate called...");
	super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
	    Bundle savedInstanceState) {
	LogUtil.i(TAG, "onCreateView called...");
	View rootView = inflater.inflate(R.layout.fragment_main, container,
		false);
	return rootView;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	LogUtil.i(TAG, "onActivityCreated called...");
    }

    @Override
    public void onStart() {
	LogUtil.i(TAG, "onStart called...");
	super.onStart();
    }

    @Override
    public void onResume() {
	LogUtil.i(TAG, "onResume called...");
	super.onResume();
    }

    @Override
    public void onPause() {
	LogUtil.i(TAG, "onPause called...");
	super.onPause();
    }

    @Override
    public void onStop() {
	LogUtil.i(TAG, "onStop called...");
	super.onStop();
    }

    @Override
    public void onDestroyView() {
	LogUtil.i(TAG, "onDestroyView called...");
	super.onDestroyView();
    }

    @Override
    public void onDestroy() {
	LogUtil.i(TAG, "onDestroy called...");
	super.onDestroy();
    }

    @Override
    public void onDetach() {
	LogUtil.i(TAG, "onDetach called...");
	super.onDetach();
    }

    

    public boolean isNullString(String imgUrl) {

	if (StringUtils.isEmpty(imgUrl)) {
	    return true;
	}
	return false;
    }

    /**
     * 显示LongToast
     */
    public void showShortToast(String pMsg) {
	// ToastUtil.createCustomToast(this, pMsg, Toast.LENGTH_LONG).show();
	Toast.makeText(ctx, pMsg, Toast.LENGTH_SHORT).show();
    }

}
